import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)


const router = new Router({
    // mode: 'history', //就是这里
    routes: [{
        path: '/',
        name: 'index',
        component: resolve => require(['@/view/mobile/index/index'], resolve),
        meta: {
            requiresAuth: false
        }
    },
    // //举报
    // {
    //     path: '/inform',
    //     name: 'inform',
    //     component: resolve => require(['@/components/mobile/inform/index'], resolve),
    //     meta: {
    //         requiresAuth: false
    //     }
    // },
    // {
    //     path: '/inform/form',
    //     name: 'informform',
    //     component: resolve => require(['@/components/mobile/inform/form'], resolve),
    //     meta: {
    //         requiresAuth: false
    //     }
    // },
    // {
    //     path: '/inform/reportsuccessify',
    //     name: 'reportsuccessify',
    //     component: resolve => require(['@/components/mobile/inform/reportsuccessify'], resolve),
    //     meta: {
    //         requiresAuth: false
    //     }
    // },
    // //查询
    // {
    //     path: '/inquiry/',
    //     name: 'inquiry',
    //     component: resolve => require(['@/components/mobile/inquiry/index'], resolve),
    //     meta: {
    //         requiresAuth: false
    //     }
    // },
    // {
    //     path: '/inquiry/failure',
    //     name: 'inquiryFailure',
    //     component: resolve => require(['@/components/mobile/inquiry/failure'], resolve),
    //     meta: {
    //         requiresAuth: false
    //     }
    // },{
    //     path: '/inquiry/result',
    //     name: 'OnLineReport',
    //     component: resolve => require(['@/components/mobile/inquiry/result'], resolve),
    //     meta: {
    //         requiresAuth: false
    //     }
    // },
    
    ]
})

export default router

// router.beforeEach((to, from, next) => {
//     if (to.matched.some(record => record.meta.requiresAuth)) {
//         if (!localStorage.getItem('token')) {
//             next({
//                 path: '/login',
//                 query: {
//                     redirect: to.fullPath
//                 }
//             })
//         } else {
//             next()
//         }
//     } else {
//         next() 
//     }
// })
